package com.hsteach.dao.domain.equipment;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hsteach.common.annotation.Excel;
import com.hsteach.common.core.domain.BaseEntity;
import com.hsteach.dao.domain.meeting.MeetingFile;
import com.hsteach.web.controller.equipment.dto.PersonVo;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *设备报修填报信息 tb_equipment_repair_info
 *
 */
@Data
public class EquipmentRepair extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 报修类型 */
    @Excel(name = "报修类型")
    private String repairType;

    /** 报修类型名称 */
    @Excel(name = "报修类型名称")
    private String repairTypeName;

    /** 所在建筑id */
    @Excel(name = "所在建筑id")
    private String buildingLocation;

    /** 所在建筑名称*/
    @Excel(name = "所在建筑名称")
    private String buildingLocationName;

    /** 所在房间id */
    @Excel(name = "所在房间id")
    private String roomLocation;

    /** 所在房间名称 */
    @Excel(name = "所在房间名称")
    private String roomLocationName;

    /** 报修描述 */
    @Excel(name = "报修描述")
    private String repairDesc;

    /** 报修人id */
    @Excel(name = "报修人id")
    private String personId;

    /** 报修人名称 */
    @Excel(name = "报修人名称")
    private String personName;

    /** 报修人电话号码 */
    @Excel(name = "报修人电话号码")
    private String personMobile;

    /** 报修时间  */
    @Excel(name = "创建时间 ")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;

    /** 更新时间  */
    @Excel(name = "更新时间 ")
    private Date updateTime;


    /** 维修状态 0待维修  1已维修 */
    @Excel(name = "维修状态 0待维修  1已维修")
    private Integer status;

    /** 是否有效 1有效 0无效 */
    @Excel(name = "是否有效 1有效 0无效")
    private Integer delStatus;

    /** 机构号 */
    @Excel(name = "机构号")
    private String orgCode;

    /**
     * 指定维修人员
     */
    private String repairPerson;

    /** 维修时间  */
    @Excel(name = "维修时间 ")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date repairTime;

    /** 维修人id */
    private String repairPersonId;

    /** 维修人id */
    private String repairPersonName;

    /** 维修人电话 */
    private String repairPersonMobile;


    private List<MeetingFile> files;

    private Date gtCreateTime;

    private Date ltCreateTime;

    List<PersonVo> persons;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("repairType", getRepairType())
                .append("buildingLocation", getBuildingLocation())
                .append("roomLocation", getRoomLocation())
                .append("repairDesc", getRepairDesc())
                .append("personId", getPersonId())
                .append("personName", getPersonName())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("status", getStatus())
                .append("orgCode", getOrgCode())
                .append("repairTime", getRepairTime())
                .append("delStatus", getDelStatus())
                .toString();
    }

    public Map<String,Object> toMap(){
        Map<String, Object> map = new HashMap<>(16);
        map.put("id",getId());
        map.put("repairType", getRepairType());
        map.put("buildingLocation", getBuildingLocation());
        map.put("buildingLocationName", getBuildingLocationName());
        map.put("roomLocation", getRoomLocation());
        map.put("roomLocationName", getRoomLocationName());
        map.put("repairDesc", getRepairDesc());
        map.put("personId", getPersonId());
        map.put("personName", getPersonName());
        map.put("createTime", getCreateTime());
        map.put("updateTime", getUpdateTime());
        map.put("status", getStatus());
        map.put("orgCode", getOrgCode());
        map.put("repairTime", getRepairTime());
        map.put("delStatus", getDelStatus());

        return map;
    }

}
